package com.cw.java8.optional.demo;

import java.io.Serializable;

/**
 * 用户实体类
 */
public class User implements Serializable {

    private Integer id;

    private String userName;

    private String passWord;



    /**
     * 链式调用起步方法，创建一个静态方法，返回该类的实例对象
     * @return
     */
    public static User Build() {
        return new User();
    }

    public Integer getId() {
        return id;
    }

    /**
     * 链式调用的set方法，都返回对象本身
     * @param id
     */
    public User setId(Integer id) {
        this.id = id;
        return this;
    }

    public String getUserName() {
        return userName;
    }

    public User setUserName(String userName) {
        this.userName = userName;
        return this;
    }

    public String getPassWord() {
        return passWord;
    }

    public User setPassWord(String passWord) {
        this.passWord = passWord;
        return this;
    }
}
